﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;

namespace BenzInfo.Hockey.LHRAF.Utils
{
    public class ImageHelper
    {
        public static void Save(Image img, string filepath, string ext) 
        {
            switch (ext)
            {
                case "png":
                    img.Save(filepath, ImageFormat.Png); break;
                case "gif":
                    img.Save(filepath, ImageFormat.Gif); break;
                case "jpg":
                    img.Save(filepath, ImageFormat.Jpeg); break;
                default:
                    img.Save(filepath, ImageFormat.Jpeg); break;
            }
        }
    }
}